{include file='../header.tpl'}

<div class="container">
    <h1 class="left-padding">

    {if $this->session->userdata('loggedin')}
        <span>
            <div id="subscribe" onclick="addCategorySubscription('{$currentCategory}')" class="{if $userIsSubscribed}hide{/if} round-button btn-green">+</div>
            <div id="unsubscribe" onclick="removeCategorySubscription('{$currentCategory}')" class="{if !$userIsSubscribed}hide{/if} round-button btn-red">-</div>
         </span>
    {/if}
        <i>{$currentCategory}</i>
    </h1>
    <div class="row personal-hero">
    {foreach from=$topThree item=post}
        <span class="span4">
            <a class="post-preview mostread" href="/post/read/{$post->getId()}">
                <h3>{$post->getTitle()}</h3>
                <p>{strip_tags(substr($post->getContent(),0,100))}</p>
            </a>
            </span>
    {/foreach}

    </div>
         <!-- Main hero unit for a primary marketing message or call to action -->
        <h1 class="left-padding">Het laatste nieuws:</h1>
        <!-- Example row of columns -->
        <div class="row category-container">
        {foreach $latestPosts as $post}
            <div class="span4 postblocks">
                <a href="/post/read/{$post->getId()}">
                <h4>{$post->getTitle()}</h4>

                <p>{strip_tags($post->getContent()|substr:0:250)}...</p>

                </a>
            </div>
           {if $post@iteration % 3 == 0 }<div class="clearme"></div>{/if}
         {/foreach}

    </div>

    {include file='../footer.tpl'}

